package com.quanshu.exchange.ui.gui.profile.member;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.widget.RelativeLayout;

import com.gyf.barlibrary.ImmersionBar;
import com.quanshu.exchange.R;
import com.quanshu.exchange.support.utils.RxViewHelper;
import com.quanshu.exchange.ui.base.BaseActivity;
import com.quanshu.shop.base.view.BaseTitleBar;

import butterknife.BindView;
import butterknife.ButterKnife;

public class MemberInfoActivity extends BaseActivity {

    @BindView(R.id.layout_member_order)
    RelativeLayout layoutMemberOrder;
    @BindView(R.id.layout_member_bind)
    RelativeLayout layoutMemberBind;
    @BindView(R.id.member_title)
    BaseTitleBar memberTitle;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_member_layout);
        ButterKnife.bind(this);
        initListener();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        ImmersionBar.with(this).destroy();
    }

    private void initListener() {
        ImmersionBar.with(this).titleBar(memberTitle).statusBarColor(R.color.white).statusBarDarkFont(true).init();
        memberTitle.setLeftImage(R.drawable.icon_back_black_2_0).setCenterText("会员推荐").setOnClickBaseTitleListener(new BaseTitleBar.OnClickBaseTitleBarListener() {
            @Override
            public void onclickLeft() {
                finish();
            }

            @Override
            public void onclickRight() {

            }
        });
        RxViewHelper.getInstance().clicks(layoutMemberOrder, aVoid -> {
            Intent intent = new Intent(this, MemberOrderListActivity.class);
            startActivity(intent);
        });
        RxViewHelper.getInstance().clicks(layoutMemberBind, aVoid -> {
            Intent intent = new Intent(this, MemberBindListActivity.class);
            startActivity(intent);
        });
    }

}
